package com.spring.demo.init.oxm;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.oxm.castor.CastorMarshaller;

/**
 * oxm 映射配置
 * 
 * @author sean
 * 
 */

@Configuration
public class OxmConfig {

	@Bean
	public CastorMarshaller castorMarshaller() {
		Resource customerInfoResource = new ClassPathResource(
				"com/spring/demo/core/entity/maping.CustomerInfo.xml");
		CastorMarshaller marshaller = new CastorMarshaller();
		marshaller.setMappingLocations(new Resource[] { customerInfoResource });

		return marshaller;
	}
}
